{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pixiedust database opened successfully\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "        <div style=\"margin:10px\">\n",
       "            <a href=\"https://github.com/ibm-watson-data-lab/pixiedust\" target=\"_new\">\n",
       "                <img src=\"https://github.com/ibm-watson-data-lab/pixiedust/raw/master/docs/_static/pd_icon32.png\" style=\"float:left;margin-right:10px\"/>\n",
       "            </a>\n",
       "            <span>Pixiedust version 1.1.10</span>\n",
       "        </div>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#SKIP_COMPARE_OUTPUT\n",
    "import pixiedust"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = [\n",
    " (\"a\", \"Alice\", 34, 60, 1),\n",
    " (\"b\", \"Bob\", 36, 70, 2),\n",
    " (\"c\", \"Charlie\", 30, 99, 6),\n",
    " (\"d\", \"Hector\", 75, 87, 9),\n",
    " (\"a\", \"Alice\", 34, 44, 12),\n",
    " (\"b\", \"Bob\", 36, 109, 33),\n",
    " (\"c\", \"Charlie\", 30, 56, 77),\n",
    " (\"d\", \"Hector\", 75, 99, 2),\n",
    " (\"a\", \"Alice\", 34, 68, 7),\n",
    " (\"b\", \"Bob\", 36, 156, 54),\n",
    " (\"c\", \"Charlie\", 30, 89, 23),\n",
    " (\"d\", \"Hector\", 75, 64, 88),\n",
    " (\"a\", \"Alice\", 34, 45, 44),\n",
    " (\"b\", \"Bob\", 36, 97, 33),\n",
    " (\"c\", \"Charlie\", 30, 85, 41),\n",
    " (\"d\", \"Hector\", 75, 79, 6),\n",
    " (\"a\", \"Alice\", 34, 63, 9),\n",
    " (\"b\", \"Bob\", 36, 100, 28),\n",
    " (\"c\", \"Charlie\", 30, 85, 12),\n",
    " (\"d\", \"Hector\", 75, 73, 9)\n",
    "]\n",
    "\n",
    "columns = [\"id\", \"name\", \"age\", \"weight\", \"something\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#TARGET=SPARK\n",
    "sqlContext = SQLContext(sc)\n",
    "dd = sqlContext.createDataFrame(data, columns)\n",
    "dd.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#TARGET=PLAIN\n",
    "import pandas\n",
    "dd = pandas.DataFrame( data, columns=columns )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_c95db292\">\n",
       "            <pd_event_handler pd_source=\"option_btn_c95db292\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"rendererc95db292\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" selected>matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" >bokeh</option>\n",
       "            \n",
       "                <option value=\"seaborn\" >seaborn</option>\n",
       "            \n",
       "                <option value=\"brunel\" >brunel</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#rendererc95db292\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTMLc95db292');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLc95db292');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executionc95db292\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executionc95db292\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executionc95db292\").length > 0 ){\n",
       "                    $(\"#executionc95db292\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDonec95db292 != \"undefined\"){\n",
       "                    onDisplayDonec95db292();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='histogram',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='c95db292')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSc95db292').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigurec95db292\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    \n",
       "                            <center><img style=\"max-width:initial !important\" src=\"\"  class=\"pd_save\"></center>\n",
       "                        \n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Histogram Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsizec95db292\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsizec95db292\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Bin Count: <span id=\"slidevalbinsizec95db292\">4</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderbinsizec95db292\"\n",
       "                        name=\"binsize\"\n",
       "                        data-min=2\n",
       "                        data-max=28\n",
       "                        data-default=4\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedmpld3c95db292\" r=\"t\" type=\"checkbox\" name=\"mpld3\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedmpld3c95db292\">D3 Rendering (mpld3)</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=c95db292]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigurec95db292\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLc95db292');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executionc95db292\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executionc95db292\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executionc95db292\").length > 0 ){\n",
       "                    $(\"#executionc95db292\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDonec95db292 != \"undefined\"){\n",
       "                    onDisplayDonec95db292();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='histogram',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='c95db292')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSc95db292').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=c95db292]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"c95db292]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigurec95db292');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLc95db292');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executionc95db292\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executionc95db292\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executionc95db292\").length > 0 ){\n",
       "                    $(\"#executionc95db292\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDonec95db292 != \"undefined\"){\n",
       "                    onDisplayDonec95db292();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='histogram',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='c95db292')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSc95db292').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"c95db292]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='histogram',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='c95db292')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_a8e8d27d\">\n",
       "            <pd_event_handler pd_source=\"option_btn_a8e8d27d\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"renderera8e8d27d\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" selected>matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" >bokeh</option>\n",
       "            \n",
       "                <option value=\"brunel\" >brunel</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#renderera8e8d27d\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTMLa8e8d27d');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLa8e8d27d');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executiona8e8d27d\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executiona8e8d27d\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executiona8e8d27d\").length > 0 ){\n",
       "                    $(\"#executiona8e8d27d\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDonea8e8d27d != \"undefined\"){\n",
       "                    onDisplayDonea8e8d27d();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='lineChart',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='a8e8d27d')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSa8e8d27d').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigurea8e8d27d\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    \n",
       "                            <center><img style=\"max-width:initial !important\" src=\"\"  class=\"pd_save\"></center>\n",
       "                        \n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Line Chart Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsizea8e8d27d\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsizea8e8d27d\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Cluster By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectclusterbya8e8d27d\" name=\"clusterby\" r=\"t\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"None\" >None</option>\n",
       "                        \n",
       "                            <option value=\"id\" >id</option>\n",
       "                        \n",
       "                            <option value=\"name\" >name</option>\n",
       "                        \n",
       "                            <option value=\"something\" >something</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedtimeseriesa8e8d27d\" r=\"f\" type=\"checkbox\" name=\"timeseries\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedtimeseriesa8e8d27d\">Time Series</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlegenda8e8d27d\" r=\"f\" type=\"checkbox\" name=\"legend\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedlegenda8e8d27d\">Show legend</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlogxa8e8d27d\" r=\"f\" type=\"checkbox\" name=\"logx\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedlogxa8e8d27d\">log scale on x</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlogya8e8d27d\" r=\"f\" type=\"checkbox\" name=\"logy\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedlogya8e8d27d\">log scale on y</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedmpld3a8e8d27d\" r=\"t\" type=\"checkbox\" name=\"mpld3\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedmpld3a8e8d27d\">D3 Rendering (mpld3)</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "$(\"[id^=optionselect][id$=a8e8d27d]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).val();\n",
       "    if (thisValue == \"None\"){\n",
       "        thisValue = null\n",
       "    }\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigurea8e8d27d\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    }\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLa8e8d27d');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executiona8e8d27d\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executiona8e8d27d\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executiona8e8d27d\").length > 0 ){\n",
       "                    $(\"#executiona8e8d27d\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDonea8e8d27d != \"undefined\"){\n",
       "                    onDisplayDonea8e8d27d();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='lineChart',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='a8e8d27d')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSa8e8d27d').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=a8e8d27d]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigurea8e8d27d\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLa8e8d27d');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executiona8e8d27d\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executiona8e8d27d\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executiona8e8d27d\").length > 0 ){\n",
       "                    $(\"#executiona8e8d27d\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDonea8e8d27d != \"undefined\"){\n",
       "                    onDisplayDonea8e8d27d();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='lineChart',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='a8e8d27d')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSa8e8d27d').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=a8e8d27d]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"a8e8d27d]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigurea8e8d27d');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLa8e8d27d');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executiona8e8d27d\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executiona8e8d27d\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executiona8e8d27d\").length > 0 ){\n",
       "                    $(\"#executiona8e8d27d\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDonea8e8d27d != \"undefined\"){\n",
       "                    onDisplayDonea8e8d27d();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='lineChart',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='a8e8d27d')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSa8e8d27d').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"a8e8d27d]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#SKIP_COMPARE_OUTPUT\n",
    "display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='lineChart',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='a8e8d27d')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_4a06eca2\">\n",
       "            <pd_event_handler pd_source=\"option_btn_4a06eca2\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"renderer4a06eca2\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" selected>matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" >bokeh</option>\n",
       "            \n",
       "                <option value=\"seaborn\" >seaborn</option>\n",
       "            \n",
       "                <option value=\"brunel\" >brunel</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#renderer4a06eca2\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTML4a06eca2');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML4a06eca2');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution4a06eca2\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution4a06eca2\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution4a06eca2\").length > 0 ){\n",
       "                    $(\"#execution4a06eca2\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone4a06eca2 != \"undefined\"){\n",
       "                    onDisplayDone4a06eca2();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='scatterPlot',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='4a06eca2')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS4a06eca2').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigure4a06eca2\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    \n",
       "                            <center><img style=\"max-width:initial !important\" src=\"\"  class=\"pd_save\"></center>\n",
       "                        \n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Scatter Plot Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsize4a06eca2\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsize4a06eca2\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedmpld34a06eca2\" r=\"t\" type=\"checkbox\" name=\"mpld3\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedmpld34a06eca2\">D3 Rendering (mpld3)</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=4a06eca2]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure4a06eca2\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML4a06eca2');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution4a06eca2\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution4a06eca2\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution4a06eca2\").length > 0 ){\n",
       "                    $(\"#execution4a06eca2\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone4a06eca2 != \"undefined\"){\n",
       "                    onDisplayDone4a06eca2();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='scatterPlot',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='4a06eca2')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS4a06eca2').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=4a06eca2]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"4a06eca2]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigure4a06eca2');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML4a06eca2');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"0B4A2B85FB23459DAEE455A3F08458CD\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution4a06eca2\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution4a06eca2\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution4a06eca2\").length > 0 ){\n",
       "                    $(\"#execution4a06eca2\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone4a06eca2 != \"undefined\"){\n",
       "                    onDisplayDone4a06eca2();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='scatterPlot',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='4a06eca2')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS4a06eca2').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"4a06eca2]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(dd,cell_id='0B4A2B85FB23459DAEE455A3F08458CD',handlerId='scatterPlot',rendererId='matplotlib',no_gen_tests='true',valueFields='weight',rowCount='100',keyFields='age',aggregation='SUM',nostore_cw='1098',nostore_pixiedust='true',nostore_bokeh='false',prefix='4a06eca2')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "pySpark (Spark 1.6.0)",
   "language": "python",
   "name": "pyspark1.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
